#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
#include<QTabBar>

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    ui->cmbButton->addItem("1", 1);
    ui->cmbButton->addItem("2", 2);
    ui->cmbButton->addItem("3", 3);
    ui->cmbButton->addItem("4", 4);

    ui->cmbWidget->addItem("1", 1);
    ui->cmbWidget->addItem("2", 2);
    ui->cmbWidget->addItem("3", 3);
    ui->cmbWidget->addItem("4", 4);

    ui->cmbView->addItem("1", 1);
    ui->cmbView->addItem("2", 2);
    ui->cmbView->addItem("3", 3);
    ui->cmbView->addItem("4", 4);
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::resizeEvent(QResizeEvent *event)
{
    Q_UNUSED(event);
    //直接将tabBar的最小值设置为qtabwidget的最小值，就可以自适应tabBar的宽度。
//    int w = this->ui->tabWidget->width();
//    this->ui->tabWidget->tabBar()->setMinimumWidth(w);
//    qDebug() << w;
}
